package com.ruoyi.sl.service.impl;

import java.math.BigDecimal;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlWsabsenceMapper;
import com.ruoyi.sl.domain.SlWsabsence;
import com.ruoyi.sl.service.ISlWsabsenceService;

/**
 * 车间扣发绩效系数Service业务层处理
 * 
 * @author admin
 * @date 2024-06-10
 */
@Service
public class SlWsabsenceServiceImpl implements ISlWsabsenceService 
{
    @Autowired
    private SlWsabsenceMapper slWsabsenceMapper;

    /**
     * 查询车间扣发绩效系数
     * 
     * @param absenceId 车间扣发绩效系数主键
     * @return 车间扣发绩效系数
     */
    @Override
    public SlWsabsence selectSlWsabsenceByAbsenceId(Long absenceId)
    {
        return slWsabsenceMapper.selectSlWsabsenceByAbsenceId(absenceId);
    }

    /**
     * 根据缺勤天数查询扣发绩效系数
     *
     * @param absenceDay 缺勤天数
     * @return 行政扣发绩效系数
     */
    @Override
    public SlWsabsence selectSlWsabsenceByAbsenceDay(BigDecimal absenceDay){
        return slWsabsenceMapper.selectSlWsabsenceByAbsenceDay(absenceDay);
    }
    /**
     * 查询车间扣发绩效系数列表
     * 
     * @param slWsabsence 车间扣发绩效系数
     * @return 车间扣发绩效系数
     */
    @Override
    public List<SlWsabsence> selectSlWsabsenceList(SlWsabsence slWsabsence)
    {
        return slWsabsenceMapper.selectSlWsabsenceList(slWsabsence);
    }

    /**
     * 新增车间扣发绩效系数
     * 
     * @param slWsabsence 车间扣发绩效系数
     * @return 结果
     */
    @Override
    public int insertSlWsabsence(SlWsabsence slWsabsence)
    {
        slWsabsence.setCreateTime(DateUtils.getNowDate());
        return slWsabsenceMapper.insertSlWsabsence(slWsabsence);
    }

    /**
     * 修改车间扣发绩效系数
     * 
     * @param slWsabsence 车间扣发绩效系数
     * @return 结果
     */
    @Override
    public int updateSlWsabsence(SlWsabsence slWsabsence)
    {
        slWsabsence.setUpdateTime(DateUtils.getNowDate());
        return slWsabsenceMapper.updateSlWsabsence(slWsabsence);
    }

    /**
     * 批量删除车间扣发绩效系数
     * 
     * @param absenceIds 需要删除的车间扣发绩效系数主键
     * @return 结果
     */
    @Override
    public int deleteSlWsabsenceByAbsenceIds(Long[] absenceIds)
    {
        return slWsabsenceMapper.deleteSlWsabsenceByAbsenceIds(absenceIds);
    }

    /**
     * 删除车间扣发绩效系数信息
     * 
     * @param absenceId 车间扣发绩效系数主键
     * @return 结果
     */
    @Override
    public int deleteSlWsabsenceByAbsenceId(Long absenceId)
    {
        return slWsabsenceMapper.deleteSlWsabsenceByAbsenceId(absenceId);
    }
}
